//
//  SortedArrayMode.m
//  SortedArrayiOS
//
//  Created by  ZhuHong on 2017/2/18.
//  Copyright © 2017年 CoderHG. All rights reserved.
//

#import "SortedArrayMode.h"

@implementation SortedArrayMode

+ (instancetype)modeWithName:(NSString*)name address:(NSString*)address phone:(NSString*)phone {
    // SortedArrayMode* mode = [[SortedArrayMode alloc] init];  很low的方法
//    SortedArrayMode* mode = [[[self class] alloc] init];  也很low的
    
    // 最好的方法
    SortedArrayMode* mode = [[self alloc] init];
    
    mode.name = name.copy;
    mode.address = address.copy;
    mode.phone = phone.copy;
    
    return mode;
}


- (NSString *)description {
    return [NSString stringWithFormat:@"name = %@, address = %@, phone = %@", self.name, self.address, self.phone];
}

@end
